<template>
  <div class="mode-options">
    <div class="mode-options-item"
         v-for="(item,index) in dataSource"
         :key="index"
         @click="$emit('onModeOptionItemClick')">
      <img :src="item.icon"
           class="mode-options-item-img">
      <span class="mode-options-item-name">{{item.title}}</span>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      dataSource: [
        {
          id: '1',
          icon: require('@img/jingDongChaoShi.png'),
          title: '京东超市'
        },
        {
          id: '2',
          icon: require('@img/haiTunQuanQiu.png'),
          title: '海屯全球'
        },
        {
          id: '3',
          icon: require('@img/jingDongFuShi.png'),
          title: '京东服饰'
        },
        {
          id: '4',
          icon: require('@img/jingDongShengXian.png'),
          title: '京东生鲜'
        },
        {
          id: '5',
          icon: require('@img/jingDongDaoJia.png'),
          title: '京东到家'
        },
        {
          id: '6',
          icon: require('@img/chongZhiJiaoFei.png'),
          title: '充值缴费'
        },
        {
          id: '7',
          icon: require('@img/jingDongChaoShi.png'),
          title: '9.9元拼'
        },
        {
          id: '8',
          icon: require('@img/lingJuan.png'),
          title: '领劵'
        },
        {
          id: '9',
          icon: require('@img/zhuanQian.png'),
          title: '赚钱'
        },
        {
          id: '10',
          icon: require('@img/quanBu.png'),
          title: '全部'
        }
      ]
    }
  }
}
</script>
<style scoped lang = 'scss'>
@import "@css/style.scss";
@import "@css/variable.scss";
.mode-options {
  display: flex;
  flex-wrap: wrap;
  background-color: white;
  padding-bottom: px2rem(14);
  &-item {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: px2rem(10);
    &-img {
      width: px2rem(40);
      height: px2rem(40);
      margin-bottom: px2rem(8);
    }
    &-name {
      font-size: px2rem($minSize);
    }
  }
}
</style>